#ifndef TEST_HPP
#define TEST_HPP

#include <iostream>
#include <string>

struct Person
{
    std::string _name;
    int _age;
    std::string _sex;

    // 构造函数
    Person(std::string name, int age, std::string sex)
        :_name(name), _age(age), _sex(sex)
    {
        std::cout << "Person(std::string name, int age, std::string sex)" << std::endl;
    }

    // 析构函数
    ~Person()
    {
        std::cout << "~Person()" << std::endl;
    }
};

// class Person
// {
// public:
//     std::string _name;
//     int _age;
//     std::string _sex;

//     // 构造函数
//     Person(std::string name, int age, std::string sex)
//         : _name(name), _age(age), _sex(sex)
//     {
//         std::cout << "Person(std::string name, int age, std::string sex)" << std::endl;
//     }

//     // 析构函数
//     ~Person()
//     {
//         std::cout << "~Person()" << std::endl;
//     }
// };

class Student : Person
{
public:
    Student(std::string name, int age, std::string sex)
        : Person(name, age, sex)
    {
    }

    void Print()
    {
        fprintf(stdout, "_name: ", _name.c_str());
    }
};

struct Teacher : Person
{
public:
    Teacher(std::string name, int age, std::string sex)
        : Person(name, age, sex)
    {
    }

    void Print()
    {
        fprintf(stdout, "_name: ", _name.c_str());
    }
};

#endif